Error installing Python packages fails with trace
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
When using the Python plugin and there's a problem installing a Python package, Snapcraft aborts with both a verbatim error message from pip as well as a long trace.
There's 3 ways to get this to happen which go through the same code path which is why I'm filing one bug for it:
- A package from index (PyPI) can't be installed.
- The URL to a VCS branch can't be cloned.
- An error occurs downloading via http(s) eg. HTTP 404.
parts:
foo:
plugin: python
python-packages:
- <email address hidden>:kalikiana/does-not-exist.git#egg=ham
- http://someserver.org/packages/MyPackage-3.0.tar.gz
See below for abbreviated traces going through "Pip.download":
Collecting pip
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
Traceback (most recent call last):
[...]
File "/home/rumo/dev/snapcraft/snapcraft/plugins/_python/_pip.py", line 196, in _ensure_pip_installed
self.download({'pip'})
[...]
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
Invalid requirement: '<email address hidden>:kalikiana/does-not-exist.git'
It looks like a path. Does it exist ?
Traceback (most recent call last):
[...]
File "/home/rumo/dev/snapcraft/snapcraft/plugins/_python/_pip.py", line 275, in download
self._python_package_dir] + args, cwd=cwd)
[...]
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
Collecting http://someserver.org/packages/MyPackage-3.0.tar.gz
HTTP error 404 while getting http://someserver.org/packages/MyPackage-3.0.tar.gz
Could not install requirement http://someserver.org/packages/MyPackage-3.0.tar.gz because of error 404 Client Error: Not Found for url: http://someserver.org/packages/MyPackage-3.0.tar.gz
Could not install requirement http://someserver.org/packages/MyPackage-3.0.tar.gz because of HTTP error 404 Client Error: Not Found for url: http://someserver.org/packages/MyPackage-3.0.tar.gz for URL http://someserver.org/packages/MyPackage-3.0.tar.gz
Traceback (most recent call last):
[...]
File "/home/rumo/dev/snapcraft/snapcraft/plugins/_python/_pip.py", line 275, in download
self._python_package_dir] + args, cwd=cwd)
[...]
File "/usr/lib/python3.5/subprocess.py", line 581, in check_call
raise CalledProcessError(retcode, cmd)
Evaluation history
No evaluation history available.